package com.usian.wemedia.controller;

import com.usian.apis.wemedia.LoginControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.dtos.WmUserDto;
import com.usian.wemedia.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//wemedia控制层实现
@RestController
@RequestMapping("/login")
public class LoginController implements LoginControllerApi {

    @Autowired
    private WmUserService wmUserService;

    //wemedia登录业务控制层
    @PostMapping("/in")
    @Override
    public ResponseResult login(@RequestBody WmUserDto dto) throws Exception {
        return wmUserService.login(dto);
    }

    //测试登录业务
    @PostMapping("/out")
    public ResponseResult logout(@RequestParam String name){
        return ResponseResult.okResult(name);
    }


}
